{% extends "agm1.0/base.html" %}
{%- block body %}  
        <section id="memberposts" wechatsignused data-role="page" data-add-back-btn="true">
            <header data-role="header" data-position="fixed">
                {% if not session.get('wechatuserid') %}
                <a href="auth2?goto=memberposts" rel="external" data-role="button" data-icon="info" class="ui-btn-right">登录</a>{% endif %}
                <h3>会员分享</h3>
            </header>  
                <div class="head_pic"><img src="/static/images/tu1.jpg"></div>
            <div data-role="content">
                <div class="postselect">
                    <select data-mini="true" data-inline="true">
                        <option value="all">全部</option>                       
                        {% for l in items.get('label')%}<option value="{{l}}">{{l}}</option>{% endfor %}                 
                    </select>                
                </div>
                <div class="share">
                <a data-role="button" class="nohash {% if 'wechatuserid' not in session %}nosession{% endif %}" href="postweb" data-mini="true" data-inline="true" data-theme="e" data-icon="plus">我要分享</a></div>
                <ul data-role="listview" data-inset="true" data-split-icon="delete" data-split-theme="c" class="ui-icon-alt">
                    {% for key in items.get('keys') %}
                    <li data-role="list-divider"{% if key==g.taglabel %} data-theme="e"{% endif %}>{{key}}<span class="ui-li-count">{{ len(items['posts'][key]) }}</span></li>
                    {% for post in items['posts'][key] %}
                    <li class="padsmall" data-bak-label="{{post.get('sharetype')}}"><a href="{{ url_for('agmbeta.memberposts', pid=post.id)}}">
                        <img src="{{ post.get('imgurls')[0]|replace('ac-m3vGPBDT.clouddn.com', 'lc-m3vgpbdt.cn-n1.lcfile.com')}}"/>
                        <h2>{{ post.get('title') }}</h2>
                        <p>{{ post.get('content') }}</p>
                        <div class="ui-li-aside">
                        <p>by <strong class="test">{{ post.get('author') or '未知'}}</strong></p>
                        <p>at <strong>{{ post.created_at.strftime('%I:%M')}}</strong> {{ post.created_at.strftime('%p')}}</p></div>
                        <span class="ui-li-count imfun_count">{{post.get('likecount')}}{% if key==g.taglabel %}票{% else %}赞{% endif %}</span>
                    </a>
                    {% if session.get('wechatrole') == 'agmadmin'%}<a href="#" class="delpost">删除</a>{% endif %}
                    </li>{% endfor %}{% endfor %}
                </ul>  
            </div>
            <footer data-role="footer" data-position="fixed"><h3><small>©2020 {{_t('AGM 英宝玩具', 'Top-Racer')}}</small></h3></footer>
        </section>
    {% endblock %}